package com.tencent.crazypenguin.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.tencent.crazypenguin.bean.User;
import com.tencent.crazypenguin.dao.UserDao;

import net.sf.json.JSONObject;

public class DemoAction2 extends ActionSupport {
	
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String result;

	@Override
	public String execute() throws Exception {
		JSONObject json;
		UserDao userDao = new UserDao();
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = userDao.findById(new Long(1), new User());
		json = JSONObject.fromObject(user);
		
		result = json.toString();
		
		return "done";
		
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}


	
	

	
	
	
	
	

}
